package com.just.gameapp.controller;

import com.just.gameapp.entity.Account;
import com.just.gameapp.service.AccountService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author zyr
 * @date 2024/6/18 下午3:06
 * @Description
 */
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/accounts")
public class AccountController {
    @Resource
    private AccountService accountService;
    @PostMapping("/register")
    public Object registerAccount(@ModelAttribute Account account){
       return accountService.registerAccount(account);
    }

    @PostMapping("/login")
    public Object loginAccount(@ModelAttribute Account account){
        return accountService.loginAccount(account);
    }

}
